package com.xujie.sportsmeeting.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 比赛成绩实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("competition_score")
public class CompetitionScore implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 成绩ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 项目ID
     */
    @NotNull(message = "项目ID不能为空")
    @TableField("event_id")
    private Long eventId;

    /**
     * 运动员ID
     */
    @NotNull(message = "运动员ID不能为空")
    @TableField("athlete_id")
    private Long athleteId;

    /**
     * 报名ID
     */
    @NotNull(message = "报名ID不能为空")
    @TableField("registration_id")
    private Long registrationId;

    /**
     * 成绩值(时间/距离/分数)
     */
    @TableField("score_value")
    private String scoreValue;

    /**
     * 成绩类型(time/distance/score)
     */
    @TableField("score_type")
    private String scoreType;

    /**
     * 排名
     */
    @TableField("ranking")
    private Integer ranking;

    /**
     * 得分
     */
    @TableField("points")
    private BigDecimal points;

    /**
     * 是否最终成绩 0-预赛 1-决赛
     */
    @TableField("is_final")
    private Integer isFinal;

    /**
     * 记录时间
     */
    @TableField("record_time")
    private LocalDateTime recordTime;

    /**
     * 记录员ID
     */
    @TableField("recorder_id")
    private Long recorderId;

    /**
     * 裁判员ID
     */
    @TableField("judge_id")
    private Long judgeId;

    /**
     * 备注
     */
    @TableField("remarks")
    private String remarks;

    /**
     * 状态 0-无效 1-有效
     */
    @TableField("status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
